package org.gry.dy20180724;

import java.util.Scanner;

public class TestJiaMi {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    char[] c = scanner.nextLine().toCharArray();
		int b1 = Integer.valueOf(String.valueOf(c[0]));
		int b2 = Integer.valueOf(String.valueOf(c[1]));
		int b3 = Integer.valueOf(String.valueOf(c[2]));
		int b4 = Integer.valueOf(String.valueOf(c[3]));
		jiaMi(b1,b2,b3,b4);
	}

	private static void jiaMi(int i, int j, int k, int l) {
		System.out.println("加密前："+i+j+k+l);
		i = (i+5)%10;
		j = (j+5)%10;
		k = (k+5)%10;
		l = (l+5)%10;
		System.out.println("加密后："+l+k+j+i);
	}
}
